<?php

class Validator {

    public static function editarDadosForm($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule( 'StNome', Rule::create(Rule::REQUIRED, true, 'Nome') );
        $Form->addRules( 'DtNascimento', array(
            Rule::create(Rule::REQUIRED, true, 'Nascimento'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Nascimento')
        ));
        $Form->addRules( 'StCpf', array(
            Rule::create(Rule::REQUIRED, true, 'Cpf'),
            Rule::create(Rule::TYPE, TypeRule::CPF, 'Cpf')
        ));
        $Form->addRule( 'StRg', Rule::create(Rule::REQUIRED, true, 'Rg') );
        $Form->addRule( 'StEndereco', Rule::create(Rule::REQUIRED, true, 'Endereço') );
        $Form->addRules( 'StNumero', array(
            Rule::create(Rule::REQUIRED, true, 'Numero'),
            Rule::create(Rule::NUMERIC, true, 'Numero')
        ));
        $Form->addRule( 'StBairro', Rule::create(Rule::REQUIRED, true, 'Bairro') );
        $Form->addRule( 'StCidade', Rule::create(Rule::REQUIRED, true, 'Cidade') );
        $Form->addRules( 'StEstado', array(
            Rule::create(Rule::REQUIRED, true, 'Estado'),
            Rule::create(Rule::MATCH, '%^[A-Za-z]{2}$%', 'Estado')
        ));
        $Form->addRules( 'StCep', array(
            Rule::create(Rule::REQUIRED, true, 'Cep'),
            Rule::create(Rule::TYPE, TypeRule::CEP, 'Cep')
        ));
        $Form->addRules( 'StEmail', array(
            Rule::create(Rule::REQUIRED, true, 'Email'),
            Rule::create(Rule::TYPE, TypeRule::EMAIL, 'Email')
        ));
        $Form->addRules( 'ItDddTelefone', array(
            Rule::create(Rule::REQUIRED, true, 'Ddd Telefone'),
            Rule::create(Rule::TYPE, TypeRule::NUMERIC, 'Ddd Telefone')
        ));
        $Form->addRules( 'StTelefone', array(
            Rule::create(Rule::REQUIRED, true, 'Telefone'),
            Rule::create(Rule::TYPE, TypeRule::PHONE, 'Telefone')
        ));
        $Form->addRules( 'ItDddCelular', array(
            Rule::create(Rule::REQUIRED, true, 'Ddd Celular'),
            Rule::create(Rule::TYPE, TypeRule::NUMERIC, 'Ddd Celular')
        ));
        $Form->addRules( 'StCelular', array(
            Rule::create(Rule::REQUIRED, true, 'Celular'),
            Rule::create(Rule::TYPE, TypeRule::PHONE, 'Celular')
        ));
        return $Form;
    }

    public static function editarSenhaForm($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule( 'StSenhaAntiga' , Rule::create(Rule::REQUIRED, true, 'Senha Antiga') );
        $Form->addRule( 'StNovaSenha' , Rule::create(Rule::REQUIRED, true, 'Nova Senha') );
        $Form->addRule( 'StConfirmacao' , Rule::create(Rule::REQUIRED, true, 'Confirmar de Senha') );
        return $Form;
    }

    public static function inserirAnotacao($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule( 'StTitulo', Rule::create(Rule::REQUIRED, true, 'Título') );
        $Form->addRule( 'TxAnotacao', Rule::create(Rule::REQUIRED, true, 'Conteúdo') );
        return $Form;
    }

    public static function editarAnotacao($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule( 'StTitulo', Rule::create(Rule::REQUIRED, true, 'Título') );
        $Form->addRule( 'TxAnotacao', Rule::create(Rule::REQUIRED, true, 'Conteúdo') );
        $Form->addRules( 'IDAnotacao', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        return $Form;
    }

    public static function deletarAnotacao($Post) {
        $Form = new FormValidator($Post);
        $Form->addRules( 'IDAnotacao', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        return $Form;
    }

    public static function inserirAviso($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule( 'StTitulo', Rule::create(Rule::REQUIRED, true, 'Título') );
        $Form->addRule( 'TxAviso', Rule::create(Rule::REQUIRED, true, 'Conteúdo') );
        $Form->addRules( 'IDCategoria', array(
            Rule::create(Rule::REQUIRED, true, 'Categoria'),
            Rule::create(Rule::NUMERIC, true, 'Categoria')
        ));
        $Form->addRules( 'IDSetor', array(
            Rule::create(Rule::REQUIRED, true, 'Setor'),
        ));
        $Form->addRules( 'DtInicio', array(
            Rule::create(Rule::REQUIRED, true, 'Iniciar em'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Iniciar em')
        ));
        $Form->addRules( 'DtDesativar', array(
            Rule::create(Rule::REQUIRED, true, 'Desativar em'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Desativar em')
        ));
        return $Form;
    }

    public static function editarAviso($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule( 'StTitulo', Rule::create(Rule::REQUIRED, true, 'Título') );
        $Form->addRule( 'TxAviso', Rule::create(Rule::REQUIRED, true, 'Conteúdo') );
        $Form->addRules( 'IDAviso', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        $Form->addRules( 'IDCategoria', array(
            Rule::create(Rule::REQUIRED, true, 'Categoria'),
            Rule::create(Rule::NUMERIC, true, 'Categoria')
        ));
        $Form->addRules( 'IDSetor', array(
            Rule::create(Rule::REQUIRED, true, 'Setor'),
            ));
        $Form->addRules( 'DtInicio', array(
            Rule::create(Rule::REQUIRED, true, 'Iniciar em'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Iniciar em')
        ));
        $Form->addRules( 'DtDesativar', array(
            Rule::create(Rule::REQUIRED, true, 'Desativar em'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Desativar em')
        ));
        return $Form;
    }

    public static function inserirSetor($Post) {
        $Form = new FormValidator($Post);
        $Form->addRules( 'IDDepartamento', array(
            Rule::create(Rule::REQUIRED, true, 'Departamento'),
            Rule::create(Rule::NUMERIC, true, 'Departamento'),
        ));
        $Form->addRule( 'StSetor', Rule::create(Rule::REQUIRED, true, 'Setor'));
        return $Form;
    }

    public static function editarSetor($Post) {
        $Form = new FormValidator($Post);

        $Form->addRules( 'IDDepartamento', array(
            Rule::create(Rule::REQUIRED, true, 'Departamento'),
            Rule::create(Rule::NUMERIC, true, 'Departamento'),
        ));
        $Form->addRules( 'IDSetor', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));

        $Form->addRule( 'StSetor', Rule::create(Rule::REQUIRED, true, 'Setor'));
        return $Form;
    }

    public static function editarFaq($Post) {
        $Form = new FormValidator($Post);

        $Form->addRule( 'StTitulo', Rule::create(Rule::REQUIRED, true, 'Título') );
        $Form->addRule( 'TxResposta', Rule::create(Rule::REQUIRED, true, 'Resposta') );
        $Form->addRules( 'IDFaq', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));

        return $Form;
    }

    public static function inserirFaq($Post) {
        $Form = new FormValidator($Post);

        $Form->addRule( 'StTitulo', Rule::create(Rule::REQUIRED, true, 'Título') );
        $Form->addRule( 'TxResposta', Rule::create(Rule::REQUIRED, true, 'Resposta') );

        return $Form;
    }

    public static function inserirDepartamento($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule( 'StDepartamento', Rule::create(Rule::REQUIRED, true, 'Departamento') );
        return $Form;
    }

    public static function editarDepartamento($Post) {
        $Form = new FormValidator($Post);
        $Form->addRules( 'IDDepartamento', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        $Form->addRule( 'StDepartamento', Rule::create(Rule::REQUIRED, true, 'Departamento') );
        return $Form;
    }

    public static function editarPlano($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule( 'StNome', Rule::create(Rule::REQUIRED, true, 'Nome do Plano') );
        $Form->addRule( 'TxDescricao', Rule::create( Rule::REQUIRED, true, 'Descrição' ) );
        $Form->addRules( 'FoPreco', array(
            Rule::create(Rule::REQUIRED, true, 'Preço'),
            Rule::create(Rule::MATCH, '%^[0-9]{1,}\.[0-9]{2}$%', 'Preço')
        ));
        $Form->addRules( 'ItDesconto', array(
            Rule::create(Rule::REQUIRED , true, 'Desconto'),
            Rule::create(Rule::NUMERIC , true, 'Desconto'),
            Rule::create(Rule::MATCH, '%(^[0-9]{1,2}$)|(^100$)%', 'Desconto'),
        ));
        $Form->addRules( 'IDPlano', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        return $Form;
    }

    public static function inserirPlano($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule( 'StNome', Rule::create(Rule::REQUIRED, true, 'Nome do Plano') );
        $Form->addRule( 'TxDescricao', Rule::create( Rule::REQUIRED, true, 'Descrição' ) );
        $Form->addRules( 'FoPreco', array(
            Rule::create(Rule::REQUIRED, true, 'Preço'),
            Rule::create(Rule::MATCH, '%^[0-9]{1,}\.[0-9]{2}$%', 'Preço')
        ));
        $Form->addRules( 'ItDesconto', array(
            Rule::create(Rule::REQUIRED , true, 'Desconto'),
            Rule::create(Rule::NUMERIC , true, 'Desconto'),
            Rule::create(Rule::MATCH, '%(^[0-9]{1,2}$)|(^100$)%', 'Desconto'),
        ));
        return $Form;
    }

    public static function inserirPerfil($Post) {
        $Form = new MultiFormValidator($Post);
        $Form->addRule('StPerfil', Rule::create( Rule::REQUIRED, true, 'Perfil' ) );
        $Form->addRules( 'IDFuncao', array(
            Rule::create(Rule::REQUIRED, true, 'Função'),
            Rule::create(Rule::NUMERIC, true, 'Função')
        ));
        return $Form;
    }

    public static function editarPerfil($Post) {
        $Form = new MultiFormValidator($Post);
        $Form->addRule('StPerfil', Rule::create( Rule::REQUIRED, true, 'Perfil' ) );
        $Form->addRules( 'IDFuncao', array(
            Rule::create(Rule::REQUIRED, true, 'Função'),
            Rule::create(Rule::NUMERIC, true, 'Função')
        ));
        $Form->addRules( 'IDPerfil', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        return $Form;
    }

    public static function editarFuncao($Post) {
        $Form = new FormValidator($Post);
        $Form->addRules( 'IDFuncao', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        $Form->addRule('StFuncao', Rule::create( Rule::REQUIRED, true, 'Função' ) );
        return $Form;
    }

    public static function inserirFuncao($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule('StFuncao', Rule::create( Rule::REQUIRED, true, 'Função' ) );
        return $Form;
    }

    public static function login($Post) {
        $Form = new FormValidator($Post);
        $Form->addRules('StNome', array(
            Rule::create(Rule::REQUIRED, true, 'Usuário'),
            Rule::create(Rule::TYPE, TypeRule::EMAIL, 'Usuário'),
        ));
        $Form->addRules('StSenha', array(
            Rule::create(Rule::REQUIRED, true, 'Senha'),
            Rule::create(Rule::LENGHT, 5, 'Senha')
        ));
        return $Form;
    }

    public static function desbloquearMensagem($Post) {
        $Form = new FormValidator($Post);
        $Form->addRules( 'IDChamado', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador do Chamado'),
            Rule::create(Rule::NUMERIC, true, 'Identificador do Chamado')
        ));
        $Form->addRules( 'IDMensagem', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        $Form->addRule( 'TxMensagem', Rule::create(Rule::REQUIRED, true, 'Mensagem') );
        return $Form;
    }

    public static function estornar($Post) {
        $Form = new FormValidator($Post);
        $Form->addRules( 'IDFinanceiro', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        $Form->addRules( 'DtData', array(
            Rule::create(Rule::REQUIRED, true, 'Data'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Data')
        ));
        $Form->addRules( 'FoValor', array(
            Rule::create(Rule::REQUIRED, true, 'Valor'),
            Rule::create(Rule::MATCH, '%^[0-9]{1,}\.[0-9]{2}$%', 'Valor')
        ));
        return $Form;
    }

    public static function editarDadosFinanceiro($Post) {
        $Form = new FormValidator($Post);
        $Form->addRule( 'IDPlano', Rule::create(Rule::REQUIRED, true, 'Plano') );
        $Form->addRule( 'EnTipoPagamento', Rule::create(Rule::REQUIRED, true, 'Tipo de Pagamento') );
        $Form->addRule( 'EnPeridicidade', Rule::create(Rule::REQUIRED, true, 'Periodicidade') );
        $Form->addRules( 'ItDesconto', array(
            Rule::create(Rule::REQUIRED, true, 'Desconto'),
            Rule::create(Rule::NUMERIC, true, 'Desconto'),
            Rule::create(Rule::MATCH, '%(^[0-9]{1,2}$)|(^100$)%', 'Desconto')
        ));
        $Form->addRules( 'IDFinanceiro', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        return $Form;
    }

    public static function inserirChamadoTelefonico($Post) {
        $Form = new FormValidator($Post);
        if( isset($Post['HasCustomer']) ) {
            $Form->addRules( 'IDCliente', array(
                Rule::create(Rule::REQUIRED, true, 'Cliente'),
                Rule::create(Rule::NUMERIC, true, 'Cliente')
            ));
        }

        $Form->addRules( 'IDSetor', array(
            Rule::create(Rule::REQUIRED, true, 'Setor'),
            Rule::create(Rule::NUMERIC, true, 'Setor')
        ));

        $Form->addRule( 'StTitulo', Rule::create(Rule::REQUIRED, true, 'Título') );
        $Form->addRule( 'TxMensagem', Rule::create(Rule::REQUIRED, true, 'Mensagem') );

        return $Form;
    }

    public static function prioridade($Post) {
        $Form = new FormValidator($Post);
        $Form->addRules( 'IDChamado', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ) );
        $Form->addRule( 'EnPrioridade', Rule::create(Rule::REQUIRED, true, 'Prioridade') );
        return $Form;
    }

    public static function trocarChamadoSetor($Post) {
        $Form = new FormValidator($Post);
        $Form->addRules( 'IDChamado', array(
            Rule::create(Rule::REQUIRED, true, 'Identificador'),
            Rule::create(Rule::NUMERIC, true, 'Identificador')
        ));
        $Form->addRules( 'IDNewSector', array(
            Rule::create(Rule::REQUIRED, true, 'Setor'),
            Rule::create(Rule::NUMERIC, true, 'Setor')
        ));
        $Form->addRules( 'IDOldSector', array(
            Rule::create(Rule::REQUIRED, true, 'Antigo Setor'),
            Rule::create(Rule::NUMERIC, true, 'Antigo Setor')
        ));
        return $Form;
    }

    public static function inserirChamadoInterno($Post) {
        $Form = new FormValidator($Post);
        $Form->addRules( 'IDSetor', array(
            Rule::create(Rule::REQUIRED, true, 'Setor'),
            Rule::create(Rule::NUMERIC, true, 'Setor')
        ));
        $Form->addRule( 'StTitulo',     Rule::create(Rule::REQUIRED, true, 'Título') );
        $Form->addRule( 'EnPrioridade', Rule::create(Rule::REQUIRED, true, 'Prioridade') );
        $Form->addRule( 'TxMensagem',   Rule::create(Rule::REQUIRED, true, 'Mensagem') );
        return $Form;
    }

    public static function salvarFuncionarioDependente($Post) {
        $Form = new MultiFormValidator($Post);

        $Form->addRules( 'StNome', array(
            Rule::create(Rule::REQUIRED, true, 'Nome'),
            Rule::create(Rule::LENGHT, 3, 'Nome')
        ));
        $Form->addRules( 'DtNascimento', array(
            Rule::create(Rule::REQUIRED, true, 'Nascimento'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BD_FORMAT, 'Nascimento')
        ));
        $Form->addRules( 'StCpf', array(
            Rule::create(Rule::REQUIRED, true, 'Cpf'),
            Rule::create(Rule::TYPE, TypeRule::CPF, 'Cpf')
        ));
        $Form->addRule( 'StRg', Rule::create(Rule::REQUIRED, true, 'Rg') );
        $Form->addRule( 'StEndereco', Rule::create(Rule::REQUIRED, true, 'Endereço') );
        $Form->addRules( 'StNumero', array(
            Rule::create(Rule::REQUIRED, true, 'Número'),
            Rule::create(Rule::NUMERIC, true, 'Número')
        ));
        $Form->addRule( 'StBairro', Rule::create(Rule::REQUIRED, true, 'Bairro') );
        $Form->addRule( 'StCidade', Rule::create(Rule::REQUIRED, true, 'Cidade') );
        $Form->addRules( 'StEstado', array(
            Rule::create(Rule::REQUIRED, true, 'Estado'),
            Rule::create(Rule::MATCH, '%[a-zA-z]{2}%', 'Estado')
        ));
        $Form->addRules( 'StCep', array(
            Rule::create(Rule::REQUIRED, true, 'Cep'),
            Rule::create(Rule::TYPE, TypeRule::CEP, 'Cep')
        ));
        $Form->addRules( 'StEmail', array(
            Rule::create(Rule::REQUIRED, true, 'Email'),
            Rule::create(Rule::TYPE, TypeRule::EMAIL, 'Email')
        ));
        $Form->addRule( 'ItRamal', Rule::create(Rule::NUMERIC, true, 'Ramal') );
        $Form->addRules( 'StDDDTelefone', array(
            Rule::create(Rule::REQUIRED, true, 'Ddd Telefone'),
            Rule::create(Rule::NUMERIC, true, 'Ddd Telefone'),
            Rule::create(Rule::MATCH, '%[0-9]{2}%', 'Ddd Telefone')
        ));
        $Form->addRules( 'StTelefone', array(
            Rule::create(Rule::REQUIRED, true, 'Telefone'),
            Rule::create(Rule::TYPE, TypeRule::PHONE, 'Telefone')
        ));
        $Form->addRules( 'StDDDCelular', array(
            Rule::create(Rule::REQUIRED, true, 'Ddd Celular'),
            Rule::create(Rule::NUMERIC, true, 'Ddd Telefone'),
            Rule::create(Rule::MATCH, '%[0-9]{2}%', 'Ddd Telefone')
        ));
        $Form->addRules( 'StCelular', array(
            Rule::create(Rule::REQUIRED, true, 'Celular'),
            Rule::create(Rule::TYPE, TypeRule::PHONE, 'Celular')
        ));
        $Form->addRule( 'EnStatus', Rule::create(Rule::REQUIRED, true, 'Status') );

        $Form->addRules( 'FoSalario', array(
            Rule::create(Rule::REQUIRED, true, 'Salário'),
            Rule::create(Rule::MATCH, '%^[0-9]{1,}\.[0-9]{2}$%', 'Salário')
        ));
        $Form->addRule( 'StBanco', Rule::create(Rule::REQUIRED, true, 'Banco') );
        $Form->addRule( 'StAgencia', Rule::create(Rule::REQUIRED, true, 'Agência') );
        $Form->addRule( 'StConta', Rule::create(Rule::REQUIRED, true, 'Conta') );
        $Form->addRule( 'EnStatus', Rule::create(Rule::REQUIRED, true, 'Status') );
        $Form->addRules( 'DtAdmissao', array(
            Rule::create(Rule::REQUIRED, true, 'Data de Admissão'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BD_FORMAT, 'Data de Admissão')
        ));
        $Form->addRule( 'DtDemissao', Rule::create(Rule::TYPE, TypeRule::DATE_BD_FORMAT, 'Data de Demissão'));
        $Form->addRule( 'EnEstadoCivil', Rule::create(Rule::REQUIRED, true, 'Estado Civil') );
        $Form->addRule( 'StPis', Rule::create(Rule::REQUIRED, true, 'Pis') );
        $Form->addRule( 'StCertificadoReservista', Rule::create(Rule::REQUIRED, true, 'Certificado de Reservista') );
        $Form->addRule( 'StTituloEleitor', Rule::create(Rule::REQUIRED, true, 'Título de Eleitor') );

        $Form->addRules( 'IDSetor', array(
            Rule::create(Rule::REQUIRED, true, 'Setor'),
            Rule::create(Rule::NUMERIC, true, 'Perfil')
        ));
        $Form->addRules( 'IDPerfil', array(
            Rule::create(Rule::REQUIRED, true, 'Perfil'),
            Rule::create(Rule::NUMERIC, true, 'Perfil')
        ));

        return $Form;
    }

    public static function salvarFuncionario($Post) {
        $DependentsForm = new MultiFormValidator($Post);
        $DependentsForm->addRules( 'DtNascimentoDependente', array(
            Rule::create(Rule::REQUIRED, true, 'Nascimento do Dependente'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Nascimento do Dependente')
        ));
        $DependentsForm->addRules( 'StNomeDependente', array(
            Rule::create(Rule::REQUIRED, true, 'Nascimento do Dependente'),
            Rule::create(Rule::LENGHT, 3, 'Nascimento do Dependente')
        ));
        $DependentsForm->addRule( 'StGrauParentesco', Rule::create(Rule::REQUIRED, true, 'Nascimento do Dependente') );
        return $DependentsForm;
    }

    public static function executarPagamento($Post) {
        $Form = new MultiFormValidator($Post);

        $Form->addRules( 'FoSalarioLiquido', array(
            Rule::create(Rule::REQUIRED, true, 'Salário'),
            Rule::create(Rule::MATCH, '%^[0-9]{1,}\.[0-9]{2}$%', 'Salário')
         ));
        $Form->addRules( 'FoDescontos', array(
            Rule::create(Rule::REQUIRED, true, 'Desconto'),
            Rule::create(Rule::MATCH, '%^[0-9]{1,}\.[0-9]{2}$%', 'Desconto')
         ));
        $Form->addRules( 'FoBonificacoes', array(
            Rule::create(Rule::REQUIRED, true, 'Bonificações'),
            Rule::create(Rule::MATCH, '%^[0-9]{1,}\.[0-9]{2}$%', 'Bonificações')
         ));
        $Form->addRules( 'DtDiaPagamento', array(
            Rule::create(Rule::REQUIRED, true, 'Dia do Pagamento'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Dia do Pagamento')
        ));

        return $Form;
    }

    public static function executarLancamento($Post) {
        $Form = new MultiFormValidator($Post);
        $Form->addRules('DtData', array(
            Rule::create(Rule::REQUIRED, true, 'Data'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Data')
        ));
        $Form->addRules('FoValor', array(
            Rule::create(Rule::REQUIRED, true, 'Valor'),
            Rule::create(Rule::MATCH, '%^[0-9]{1,}\.[0-9]{2}$%', 'Valor')
        ));
        $Form->addRule( 'EnTipoPagamento', Rule::create(Rule::REQUIRED, true, 'Tipo de Pagamento') );
        return $Form;
    }

    public static function editarCliente($Post) {
        $Form = new MultiFormValidator($Post);

        $Form->addRule( 'StNome', Rule::create(Rule::REQUIRED, true, 'Nome') );
        $Form->addRules( 'StCpf', array(
            Rule::create(Rule::REQUIRED, true, 'Cpf'),
            Rule::create(Rule::TYPE, TypeRule::CPF, 'Cpf')
        ));
        $Form->addRule( 'StRg', Rule::create(Rule::REQUIRED, true, 'Rg') );
        $Form->addRules( 'DtNascimento', array(
            Rule::create(Rule::REQUIRED, true, 'Nascimento'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Nascimento')
        ));

        $Form->addRules( 'StEmail', array(
            Rule::create(Rule::REQUIRED, true, 'Email'),
            Rule::create(Rule::TYPE, TypeRule::EMAIL, 'Email')
        ));
        $Form->addRule( 'StEndereco', Rule::create(Rule::REQUIRED, true, 'Endereço') );
        $Form->addRules( 'StNumero', array(
            Rule::create(Rule::REQUIRED, true, 'Número'),
            Rule::create(Rule::NUMERIC, true, 'Número')
        ));
        $Form->addRule( 'StBairro', Rule::create(Rule::REQUIRED, true, 'Bairro') );
        $Form->addRule( 'StCidade', Rule::create(Rule::REQUIRED, true, 'Cidade') );
        $Form->addRules( 'StEstado', array(
            Rule::create(Rule::REQUIRED, true, 'Estado'),
            Rule::create(Rule::MATCH, '%^[A-Za-z]{2}$%', 'Estado')
        ));
        $Form->addRules( 'StDDDTelefone', array(
            Rule::create(Rule::REQUIRED, true, 'Ddd Telefone'),
            Rule::create(Rule::NUMERIC, true, 'Ddd Telefone'),
            Rule::create(Rule::MATCH, '%[0-9]{2}%', 'Ddd Telefone')
        ));
        $Form->addRules( 'StTelefone', array(
            Rule::create(Rule::REQUIRED, true, 'Telefone'),
            Rule::create(Rule::TYPE, TypeRule::PHONE, 'Telefone')
        ));
        $Form->addRules( 'StDDDCelular', array(
            Rule::create(Rule::REQUIRED, true, 'Ddd Celular'),
            Rule::create(Rule::NUMERIC, true, 'Ddd Telefone'),
            Rule::create(Rule::MATCH, '%[0-9]{2}%', 'Ddd Telefone')
        ));
        $Form->addRules( 'StCelular', array(
            Rule::create(Rule::REQUIRED, true, 'Celular'),
            Rule::create(Rule::TYPE, TypeRule::PHONE, 'Celular')
        ));

        $Form->addRule('StRazaoSocial', Rule::create(Rule::REQUIRED, true, 'Razão Social'));
        $Form->addRule('StNomeFantasia', Rule::create(Rule::REQUIRED, true, 'Nome Fantasia'));
        $Form->addRule('DtFundacao', Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Data de Fundação'));
        $Form->addRules('StCnpj', array(
            Rule::create(Rule::REQUIRED, true, 'Cnpj'),
            Rule::create(Rule::TYPE, TypeRule::CNPJ, 'Cnpj')
        ));
        $Form->addRule('StCargo', Rule::create(Rule::REQUIRED, true, 'Cargo'));

        $Form->addRules( 'IDCliente', array(
            Rule::create(Rule::REQUIRED, true, 'Cliente'),
            Rule::create(Rule::NUMERIC, true, 'Cliente')
        ));
        return $Form;
    }

    public static function inserirCliente($Post) {
        $Form = new MultiFormValidator($Post);

        $Form->addRule( 'StNome', Rule::create(Rule::REQUIRED, true, 'Nome') );
        $Form->addRules( 'StCpf', array(
            Rule::create(Rule::REQUIRED, true, 'Cpf'),
            Rule::create(Rule::TYPE, TypeRule::CPF, 'Cpf')
        ));
        $Form->addRule( 'StRg', Rule::create(Rule::REQUIRED, true, 'Rg') );
        $Form->addRules( 'DtNascimento', array(
            Rule::create(Rule::REQUIRED, true, 'Nascimento'),
            Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Nascimento')
        ));

        $Form->addRules( 'StEmail', array(
            Rule::create(Rule::REQUIRED, true, 'Email'),
            Rule::create(Rule::TYPE, TypeRule::EMAIL, 'Email')
        ));
        $Form->addRule( 'StEndereco', Rule::create(Rule::REQUIRED, true, 'Endereço') );
        $Form->addRules( 'StNumero', array(
            Rule::create(Rule::REQUIRED, true, 'Número'),
            Rule::create(Rule::NUMERIC, true, 'Número')
        ));
        $Form->addRule( 'StBairro', Rule::create(Rule::REQUIRED, true, 'Bairro') );
        $Form->addRule( 'StCidade', Rule::create(Rule::REQUIRED, true, 'Cidade') );
        $Form->addRules( 'StEstado', array(
            Rule::create(Rule::REQUIRED, true, 'Estado'),
            Rule::create(Rule::MATCH, '%^[A-Za-z]{2}$%', 'Estado')
        ));
        $Form->addRules( 'StDDDTelefone', array(
            Rule::create(Rule::REQUIRED, true, 'Ddd Telefone'),
            Rule::create(Rule::NUMERIC, true, 'Ddd Telefone'),
            Rule::create(Rule::MATCH, '%[0-9]{2}%', 'Ddd Telefone')
        ));
        $Form->addRules( 'StTelefone', array(
            Rule::create(Rule::REQUIRED, true, 'Telefone'),
            Rule::create(Rule::TYPE, TypeRule::PHONE, 'Telefone')
        ));
        $Form->addRules( 'StDDDCelular', array(
            Rule::create(Rule::REQUIRED, true, 'Ddd Celular'),
            Rule::create(Rule::NUMERIC, true, 'Ddd Telefone'),
            Rule::create(Rule::MATCH, '%[0-9]{2}%', 'Ddd Telefone')
        ));
        $Form->addRules( 'StCelular', array(
            Rule::create(Rule::REQUIRED, true, 'Celular'),
            Rule::create(Rule::TYPE, TypeRule::PHONE, 'Celular')
        ));

        $Form->addRule('StRazaoSocial', Rule::create(Rule::REQUIRED, true, 'Razão Social'));
        $Form->addRule('StNomeFantasia', Rule::create(Rule::REQUIRED, true, 'Nome Fantasia'));
        $Form->addRule('DtFundacao', Rule::create(Rule::TYPE, TypeRule::DATE_BR_FORMAT, 'Data de Fundação'));
        $Form->addRules('StCnpj', array(
            Rule::create(Rule::REQUIRED, true, 'Cnpj'),
            Rule::create(Rule::TYPE, TypeRule::CNPJ, 'Cnpj')
        ));
        $Form->addRule('StCargo', Rule::create(Rule::REQUIRED, true, 'Cargo'));
        
        return $Form;
    }

}

?>